package com.hejun.bos.service.base.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hejun.bos.dao.base.CourierRepository;
import com.hejun.bos.domain.base.Courier;
import com.hejun.bos.service.base.CourierService;

@Service
@Transactional
public class CourierServiceImpl implements CourierService {
	@Autowired
	private CourierRepository courierRepository;
	@Override
	public Page<Courier> findAll(Specification<Courier> specification,Pageable pageable) {
		return courierRepository.findAll(specification,pageable);
	}
	@Override
	public void save(Courier courier) {
		courierRepository.save(courier);
	}
	@Override
	public void update(Character flag,String id) {
		String[] ids=id.split(",");
		for(String cid:ids){
			int i=Integer.parseInt(cid);
			courierRepository.update(flag,i);
		}
	}

}
